#!/bin/sh

#killall mongod
#kill -15 `pgrep mongod`

mongod --shutdown --dbpath tmp/mongod/

# pgrep mongod

# if [ $? -eq 0 ]; then
# mongo <<EOF
# use admin
# db.shutdownServer()
# EOF
# fi

if [ -d tmp/mongod ]; then
    rm -rf tmp/mongod
fi

mkdir -p tmp/mongod

mongod --fork --dbpath tmp/mongod --logpath tmp/mongod/log.db

